/**
 * Yolema.com Inc.
 * Copyright (c) 2011-2012 All Rights Reserved.
 */
package org.grayrabbit.pay.core.biz.manager.trade;

import org.grayrabbit.pay.core.biz.vo.ChinaPayTradeVo;
import org.grayrabbit.pay.core.model.entity.transaction.Trade;
import org.grayrabbit.pay.core.model.results.GenericsResult;
import org.grayrabbit.pay.core.model.results.PayResult;

/**
 * 银联交易接口
 * 
 * @author wy
 * @version $Id: ChinaPayTrade.java, v 0.1 2012-11-6 下午3:09:21 wy Exp $
 */
public interface ChinaPayTradeManager {

    /**
     * 更新一个对象
     *  非主键更新,根据交易id
     * 
     * @param trade
     * @return
     */
    public PayResult updateChinaPay(Trade trade);

    /**
     * 保存交易
     * 
     * @param chinaPayTrade
     * @return
     */
    public GenericsResult<Trade> saveTrade(ChinaPayTradeVo chinaPayTrade);

    /**
     * 退款
     * 
     * @param chinaPayTrade
     * @return
     */
    public GenericsResult<Trade> saveRefundTrade(ChinaPayTradeVo chinaPayTrade);

    /**
     * 获取交易状态
     * 
     * @param chinaPayTrade
     * @return
     */
    public GenericsResult<Trade> tradeStatus(ChinaPayTradeVo chinaPayTrade);

    /**
     * 获取退款交易状态
     * 
     * @param chinaPayTrade
     * @return
     */
    public GenericsResult<String> refundStatus(ChinaPayTradeVo chinaPayTrade);

    /**
     * 查询交易
     * 
     * @param systemCode
     * @param transId 银联交易编号
     * @param orderId 本系统编号
     * @return
     */
    public GenericsResult<Trade> query(String systemCode, String transId, String orderId);

}
